// pages/remarkinfo/remarkinfo.js
const HTTP = require('../../utils/util');
Page({

    /**
     * 页面的初始数据
     */
    data: {
        height: wx.getSystemInfoSync().windowHeight - 212 +'px',
        iconList: [
            {
                src: HTTP.host + '/static/index/images/icon_tuijian.png',
                value: '强烈推荐',
                id: 1
            },
            {
                src: HTTP.host + '/static/index/images/icon_henmanyi.png',
                value: '很满意',
                id: 2
            },
            {
                src: HTTP.host + '/static/index/images/icon_haibucuo.png',
                value: '还不错',
                id: 3
            },
            {
                src: HTTP.host + '/static/index/images/icon_yiban.png',
                value: '一般',
                id: 4
            },
            {
                src: HTTP.host + '/static/index/images/icon_chaping.png',
                value: '差评',
                id: 5
            }
        ],
        order_id:'',
        create_time:'',
        payment:'',
        imgList:[],
        shop_id:'',
        shop_name:'',
        status:0
    },
    goShopDetail(){
        wx.navigateTo({
            url:'../shopdetails/shopdetails?id='+this.data.shop_id
        });
    },
    getRemarkInfo(){
        HTTP.getData('/api/order/evaluateList',{
            order_id:this.data.order_id
        },res=>{
            console.log(res);
            this.setData({
                content:res.data.content,
                create_time:res.data.create_time,
                payment:res.data.payment,
                imgList:res.data.pic,
                shop_id:res.data.shop_id,
                shop_name:res.data.shop_name,
                status:res.data.status
            });
        });
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        console.log(options.id)
        this.setData({
            order_id:options.id
        });
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        this.getRemarkInfo();
    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})